using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
namespace Net35.Xrm.Sdk
{
	[DataContract(Namespace = "http://schemas.microsoft.com/xrm/2011/Contracts"), KnownType("GetKnownParameterTypes")]
	public sealed class RemoteExecutionContext : IPluginExecutionContext, IExecutionContext, IExtensibleDataObject
	{
		private int _stage;
		private int _mode;
		private int _depth;
		private int _isolationMode;
		private string _messageName;
		private string _primaryEntityName;
		private string _secondaryEntityName;
		private string _organizationName;
		private bool _isOffline;
		private bool _isOfflinePlayback;
		private bool _isInTransaction;
		private ParameterCollection _inputParameters;
		private ParameterCollection _outputParameters;
		private ParameterCollection _sharedVariables;
		private Guid _userId;
		private Guid _initiatingUserId;
		private Guid _businessUnitId;
		private Guid _organizationId;
		private Guid _correlationId;
		private Guid _primaryEntityId;
		private Guid _asyncOperationId;
		private Guid? _requestId;
		private EntityReference _owningExtension;
		private EntityImageCollection _preImages;
		private EntityImageCollection _postImages;
		private DateTime _operationCreatedOnTime;
		private RemoteExecutionContext _parentContext;
		private ExtensionDataObject _extensionDataObject;
		[DataMember]
		public int Stage
		{
			get
			{
				return this._stage;
			}
			set
			{
				this._stage = value;
			}
		}
		[DataMember]
		public int Mode
		{
			get
			{
				return this._mode;
			}
			set
			{
				this._mode = value;
			}
		}
		[DataMember]
		public string MessageName
		{
			get
			{
				return this._messageName;
			}
			set
			{
				this._messageName = value;
			}
		}
		[DataMember]
		public string PrimaryEntityName
		{
			get
			{
				return this._primaryEntityName;
			}
			set
			{
				this._primaryEntityName = value;
			}
		}
		[DataMember]
		public string SecondaryEntityName
		{
			get
			{
				return this._secondaryEntityName;
			}
			set
			{
				this._secondaryEntityName = value;
			}
		}
		[DataMember]
		public Guid? RequestId
		{
			get
			{
				return this._requestId;
			}
			set
			{
				this._requestId = value;
			}
		}
		[DataMember]
		public ParameterCollection InputParameters
		{
			get
			{
				if (this._inputParameters == null)
				{
					this._inputParameters = new ParameterCollection();
				}
				return this._inputParameters;
			}
		}
		[DataMember]
		public ParameterCollection OutputParameters
		{
			get
			{
				if (this._outputParameters == null)
				{
					this._outputParameters = new ParameterCollection();
				}
				return this._outputParameters;
			}
		}
		[DataMember]
		public ParameterCollection SharedVariables
		{
			get
			{
				if (this._sharedVariables == null)
				{
					this._sharedVariables = new ParameterCollection();
				}
				return this._sharedVariables;
			}
		}
		[DataMember]
		public Guid UserId
		{
			get
			{
				return this._userId;
			}
			set
			{
				this._userId = value;
			}
		}
		[DataMember]
		public Guid InitiatingUserId
		{
			get
			{
				return this._initiatingUserId;
			}
			set
			{
				this._initiatingUserId = value;
			}
		}
		[DataMember]
		public Guid BusinessUnitId
		{
			get
			{
				return this._businessUnitId;
			}
			set
			{
				this._businessUnitId = value;
			}
		}
		[DataMember]
		public Guid OrganizationId
		{
			get
			{
				return this._organizationId;
			}
			set
			{
				this._organizationId = value;
			}
		}
		[DataMember]
		public string OrganizationName
		{
			get
			{
				return this._organizationName;
			}
			set
			{
				this._organizationName = value;
			}
		}
		[DataMember]
		public EntityImageCollection PreEntityImages
		{
			get
			{
				if (this._preImages == null)
				{
					this._preImages = new EntityImageCollection();
				}
				return this._preImages;
			}
		}
		[DataMember]
		public EntityImageCollection PostEntityImages
		{
			get
			{
				if (this._postImages == null)
				{
					this._postImages = new EntityImageCollection();
				}
				return this._postImages;
			}
		}
		[DataMember]
		public Guid CorrelationId
		{
			get
			{
				return this._correlationId;
			}
			set
			{
				this._correlationId = value;
			}
		}
		[DataMember]
		public int Depth
		{
			get
			{
				return this._depth;
			}
			set
			{
				this._depth = value;
			}
		}
		[DataMember]
		public bool IsExecutingOffline
		{
			get
			{
				return this._isOffline;
			}
			set
			{
				this._isOffline = value;
			}
		}
		[DataMember]
		public bool IsOfflinePlayback
		{
			get
			{
				return this._isOfflinePlayback;
			}
			set
			{
				this._isOfflinePlayback = value;
			}
		}
		[DataMember]
		public int IsolationMode
		{
			get
			{
				return this._isolationMode;
			}
			set
			{
				this._isolationMode = value;
			}
		}
		[DataMember]
		public bool IsInTransaction
		{
			get
			{
				return this._isInTransaction;
			}
			set
			{
				this._isInTransaction = value;
			}
		}
		[DataMember]
		public Guid OperationId
		{
			get
			{
				return this._asyncOperationId;
			}
			set
			{
				this._asyncOperationId = value;
			}
		}
		[DataMember]
		public EntityReference OwningExtension
		{
			get
			{
				return this._owningExtension;
			}
			set
			{
				this._owningExtension = value;
			}
		}
		[DataMember]
		public Guid PrimaryEntityId
		{
			get
			{
				return this._primaryEntityId;
			}
			set
			{
				this._primaryEntityId = value;
			}
		}
		[DataMember]
		public DateTime OperationCreatedOn
		{
			get
			{
				return this._operationCreatedOnTime;
			}
			set
			{
				this._operationCreatedOnTime = value;
			}
		}
		[DataMember]
		public RemoteExecutionContext ParentContext
		{
			get
			{
				return this._parentContext;
			}
			set
			{
				this._parentContext = value;
			}
		}
		IPluginExecutionContext IPluginExecutionContext.ParentContext
		{
			get
			{
				return this.ParentContext;
			}
		}
		public ExtensionDataObject ExtensionData
		{
			get
			{
				return this._extensionDataObject;
			}
			set
			{
				this._extensionDataObject = value;
			}
		}
		private static IEnumerable<Type> GetKnownParameterTypes()
		{
			return KnownTypesProvider.RetrieveKnownValueTypes();
		}
	}
}
